#pragma  once

#include "Common.h"
#include "organ/MasterControl.h"
#include "communication/serial/AsyncSerial.h"
#include "conf/Config.h"
#include "communication/session/OrganSession.h"
#include "organ/Shifter.h"

struct MoveCommand
{
	MoveCommand(MoveType type, uint32 tm):
	moveType(type),
	tmKeepMS(tm)
	{
		
	};
	MoveType	moveType;
	uint32		tmKeepMS;
};


class AICtrler:public MasterControl
{
private:
	ConfigFile  m_config;
	std::deque<MoveCommand> m_MoveCmd;
public:
	AICtrler(Assembler* pAssm);
	virtual ~AICtrler();
	virtual  ErrorCode Init();

	void  OnReady(uint32 ready );
	ErrorCode PushData(char* pData, uint32 nLen) ;
	ErrorCode OnReceive(DataPacket& pack) ;

	ErrorCode Update(uint32 dtTime);



};